home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
util
/
misc
/
cookie21.lha
/
Cookie
/
README.First
< prev
next >
Wrap
Text File
|
1995-09-04
|
4KB
|
117 lines
This is the 'cookie' fortune cookie program, version 2.1.
Original Unix version by Karl Lehenbauer
Amiga version by Andreas M. Kirchwitz
Improved Amiga version by J÷rgen Grahn
J÷rgen Grahn
Wetterlinsgatan 13e
521 34 Falk÷ping
Sverige / Sweden / SuΦde
I (J÷G) didn't write this program, or port it to the Amiga. The other two
guys did. I enhanced it to v2.0 and v2.1. This file is a third level of
documentation which overrides the two other (README, README.AMIGA).
Changes from cookie/cookhash 2.0 to
cookie/cookhash 2.1 (1995-08-22):
o Compiled with SAS/C 6.55.
o Cookie looks, per default, for cookie and hash files as
"Data:Div/cookies.txt" and "Data:Div/cookies.hash".
Actually, this was in 2.0 as well, but not documented.
If you don't want that setup, you can, as always, give
cookie its command-line arguments, or use an alias.
There is no really good place in the standard Amiga setup
for data files like these. "S:" is a _bad_ place.
o Randomly selecting a cookie is a delicate process.
You must treat the random numbers carefully; with only minor
differences in the state of your computer (mainly the
system clock), you must generate a different number each time
the program is invoked, and no cookies must be unreachable -
all must have a roughly equal chance of being selected.
As mentioned below, 'cookie' used to select its output from
a _subset_ of the cookie file. Either seeding, ranging or the
randomizing process wasn't good enough. Therefore, I replaced the
pseudo-random number algorithms with R250, a PD algorithm
found on
wcarchive.cdrom.com
as
/pub/algorithms/c/r250/r250.[ch]
That module also implements good ranging (just like
really_random() does, better that rand % n); as a result,
the output seems more variated. It should now happen
more rarely that you see the same cookie twice.
o Due to the new random routines being ported from PCs,
the cookie files are currently limited to around
32,000 cookies.
o I've added many new cookies/quotes to my cookie file.
It now has about 800 cookies, and is a mere 147kB large.
Changes from Andreas' port of Karl's cookie/cookhash 1.1 to
cookie/cookhash 2.0:
o I haven't touched their documentation. This file is a third
level of documentation which overrides the two other
(README, README.AMIGA).
o I always thought the randomness of the cookies was... inferior.
If I add cookies and rehash the file, a completely new set of
cookies will be displayed. Cookies seem to be selected from a
small subset of the database. I reverted to the original
ranged-random code, which seems to be better.
o The format of the cookie file was a bit unclear. It used to be,
although not documented (note the closing "%%", it was needed
if you want the last cookie to be selectable):
cookie
%%
cookie
%%
... O L D F O R M A T
%%
cookie
%%
To this, I added the possibility of comments on the line
after the "%%". Then I decided to change 'cookhash' again -
that's where most of the parsing happens - to use flex rules.
I could then make the format even better. You should now view
the '%%' rows as comments introducing the cookie. An example:
%%
%% This cookie is really cool.
%%
- Huh-huh. Huh-huh-huh.
- Heh-heh hehehhehe-heeeeeeeiiiiiiaaaaa!
-Beavis & Butt-head
%%
Hi, my name is Lolita, an' this here is Tanqueray. Since we're all about
to die, we were wondering if you'd like to be our last boyfriends on earth?
-Beavis & Butt-head: Tornado
%% Yet another short cookie:
core dumped: your fault
%% the last cookie:
I've seen the future baby - it is murder
Leonard Cohen
Thus: '%%' _before_, not after each cookie!
o Due to the changed format, the 'onecookie' utility may or may not
work. I won't fix that.
- J÷rgen 1995-04-20, 1995-08-22